package com.springboot.controller;

import com.springboot.Service.BookService;
import com.springboot.Service.HistoryService;
import com.springboot.entity.Booktype;
import com.springboot.utils.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(value = "提供了查询、增加等相关的接口",tags = "图书借阅管理")
@CrossOrigin
@RestController
public class HistoryFood {
    @Resource
    private HistoryService historyService;
    @RequestMapping(value = "/HistoryListZero",method = RequestMethod.GET)
    @ApiOperation("还书查询分页接口")
    public ResultVO showListOne(@RequestParam(defaultValue = "1") int pageNum) {
        return historyService.historyListZero(pageNum);
    }
    @RequestMapping(value = "/HistoryListOne",method = RequestMethod.GET)
    @ApiOperation("借书查询分页接口")
    public ResultVO showListZero(@RequestParam(defaultValue = "1") int pageNum) {
        return historyService.historyLisOne(pageNum);
    }
    @RequestMapping(value = "/saveHistoryZero",method = RequestMethod.GET)
    @ApiOperation("还书接口")
    public ResultVO saveHistoryZero(com.springboot.entity.History history){
        return historyService.saveHistoryZero(history);
    }
    @RequestMapping(value = "/saveHistoryOne",method = RequestMethod.GET)
    @ApiOperation("延期接口")
    public ResultVO saveHistoryOne(com.springboot.entity.History history){
        return historyService.saveHistoryOne(history);
    }
}
